import createEditor from './editor'

const editor = createEditor()

document.body.appendChild(editor)
let lastEditor = editor

module.hot.accept('./editor', () => {
  const value = lastEditor.innerHTML
  document.body.removeChild(lastEditor)
  const newEditor = createEditor()
  newEditor.innerHTML = value
  document.body.appendChild(newEditor)
  lastEditor = newEditor
})